package Collection;

import java.util.ArrayList;
import java.util.Iterator;

/**
 * @author wuhan
 * @date 2019/9/24 14:27
 */
public class Demo1 {
    public static void main(String[] args) {
        ArrayList al=new ArrayList();
        al.add("java01");        al.add("java02");
        al.add("java03");
        al.add("java04");
        System.out.println(al.size());
        System.out.println(al);
        al.remove("java02");
        System.out.println(al);
//        al.clear();
//        System.out.println(al);
//        System.out.println(al.);
        ArrayList al1=new ArrayList();
        al1.add("java01");
        al1.add("java04");
//迭代器的基本使用
        Iterator it = al.iterator();
        while (it.hasNext()){
            System.out.println(it.next());
        }


    }

}
